<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>局部组件注册</title>
</head>
<body>

<div id="app">
  <com-a></com-a>
</div>

<script src="../lib/vue.js"></script>
<script>

  let comA = {
    data: function () {
      return {
        count: 0
      }
    },
    template: '<button @click="add">点击了 {{count}} 次</button>',
    methods: {
      add() {
        this.count++
      }
    }
  }

  let vm = new Vue({
    el: '#app',
    components: {
      'com-a': comA
    }
  })
</script>

</body>
</html>